# !/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import time


def now_day_time():
    """
        获取当前当时:2018-03-05 为字符串 20180305格式
    """
    return time.strftime('%Y%m%d', time.localtime(time.time()))


def now_time_str():
    """
    获取当前当时:2018-03-05 12:30:30 为字符串类型
    """
    return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))


def now_time_dt():
    """
    获取当前当时:2018-03-05 12:30:30 为datetime类型
    """
    return datetime.datetime.strptime(now_time_str(), '%Y-%m-%d %H:%M:%S')



